<%@ Reference Control="~/Controls/PagingControl.ascx" %>
<%@ Page language="vb" Inherits="_2bMatesSite.messages_group_bulletin" CodeFile="messages_group_bulletin.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<%@ Register tagprefix="Pager" Tagname="DataGridPager" Src="Controls/PagingControl.ascx" %>
<form id="Form1" method="post" runat="server">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="100%">
		<tr>
			<td align="left" id="table_orange" class="menu_white" height="21"><b><asp:literal id="litMainPageTitle" runat="server">Messages&nbsp;-&nbsp;Group Bulletin</asp:literal></b></td>									
		</tr>
		<tr>
			<td valign="top" width="769" height="100%" class="main_table_border"><!--769-->
				<table border="0" cellpadding="0" cellspacing="1" width="100%" height="99%">
					<tr>
						<td align="center" colspan="2" class="small" valign="top">
							<table cellSpacing="0" cellPadding="0" width="739" border="0" height="100%">
								<tr id="trUserCanceledMessage" runat=server class="hidden">
									<td align=center height="20"><asp:label id="lblErrMessageCanceled" runat=server cssclass="err_canceled_user">This member has cancelled their membership.</asp:label></td>
								</tr>
								<tr>
									<td class="small" height="10">&nbsp;</td>
								</tr>
								<tr>
									<td vAlign="top" align="center">
										<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
											<tr>
												<td vAlign="top" align="left" width="125">
													<table class="bulletin_border_bottom_menu" cellSpacing="0" cellPadding="0" width="125" border="0">
														<tr>
															<td class="bulletin_border_group" vAlign="top" align="center"><IMG src="images/inbox_image_white.gif" align="center">
																<asp:hyperlink id="hlUMInbox" runat=server cssclass="mail" navigateurl="../messages_inbox.aspx">Inbox</asp:hyperlink></td>
														</tr>
													</table>
												</td>												
												<td vAlign="top" align="left" width="133">
													<table class="bulletin_border_bottom_menu" cellSpacing="0" cellPadding="0" width="133" border="0">
														<tr>
															<td class="bulletin_border_last" vAlign="top" align="center"><IMG src="images/sent_image.gif" align="center">
															<asp:hyperlink id="hlUMSent" runat=server cssclass="mail" navigateurl="../messages_sent.aspx">Sent</asp:hyperlink></td>
														</tr>
													</table>
												</td>												
												<td vAlign="top" align="left" width="131">
													<table class="bulletin_border_bottom_menu" cellSpacing="0" cellPadding="0" width="131" border="0">
														<tr>														
															<td class="bulletin_border_left_bulletin_on" vAlign="top" align="center"><IMG src="images/group_bulletin_image_on.gif" align="center">
																<asp:literal id="litUGrpBulletin" runat="server">Group Bulletin</asp:literal></td>
														</tr>
													</table>
												</td>
												<td vAlign="top" align="left" width="132">
													<table class="bulletin_border_bottom_menu" cellSpacing="0" cellPadding="0" width="132" border="0">
														<tr>
															<td class="bulletin_border_left" vAlign="top" align="center"><IMG src="images/trash_image.gif" align="center">
																<asp:hyperlink id="hlUMTrash" runat=server cssclass="mail" navigateurl="../messages_trash.aspx">Trash</asp:hyperlink></td>
														</tr>
													</table>
												</td>		
												<td class="small" width="100%" valign="bottom"> <!-- width="56"-->
													<table class="bulletin_border_bottom_menu" cellSpacing="0" cellPadding="0" width="100%"
														border="0">
														<tr>
															<td class="confirm_friends" align="right"><asp:hyperlink id="hlConfirmFriends" runat="server" navigateurl="../view_awaiting_confirm.aspx" cssclass="confirm_friends">Confirm Friends &gt;</asp:hyperlink>&nbsp;&nbsp;</td>
														</tr>
													</table>
												</td>
											</tr>
											<tr>
												<td class="bulletin_border_bottom" vAlign="top" align="center" colSpan="13" height="100%">
													<table cellSpacing="0" cellPadding="0" width="100%" border="0">
														<tr>
															<td class="small" height="15">&nbsp;</td>
														</tr>
														<tr>
															<td class="profile">&nbsp;&nbsp;<asp:Label id="lblLegend" runat="server" font-bold="true">Legend:</asp:Label> &nbsp;&nbsp;<IMG src="images/sent_image_orange.gif" align="absmiddle"> 
															<asp:Label id="lblMail" runat="server" cssclass="profile"  font-bold="true">Mail</asp:Label>							
															&nbsp;&nbsp;&nbsp;&nbsp;<IMG src="images/bulletin_image.gif" align="absmiddle">&nbsp;<asp:Label id="lblBulletin" runat="server" cssclass="profile"  font-bold="true">Bulletin</asp:Label>
															&nbsp;&nbsp;&nbsp;&nbsp;<IMG src="images/group_bulletin_image_orange.gif" align="absmiddle">&nbsp;<asp:Label id="lblGroupBulletin" runat="server" cssclass="profile"  font-bold="true">Group Bulletin</asp:Label></td>
														</tr>													
														<tr>
															<td class="small" height="15">&nbsp;</td>
														</tr>																										
														<!--
														<tr>
															<td class="blue_inbox"><A href="send_message.aspx"><b>Send Message</b></A></td>
														</tr>
														-->
														<tr>
															<td><asp:label id="lblNoMessages" runat="server" Visible="False" CssClass="blue_inbox">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;There are no messages in this folder.</asp:label></td>
														</tr>
														<tr>
															<td><asp:table id="tblMessages" runat="server">
																	<asp:TableRow VerticalAlign="Top">
																		<asp:TableCell VerticalAlign="Top">
																			<table cellspacing="0" cellpadding="0" border="0" width="100%">
																				<!--<tr>
																					<td class="bulletin_spacer_dark"><IMG height="1" src="images/spacer.gif" width="100%"></td>
																				</tr>-->
																				<tr>
																					<td valign="middle">
																						<PAGER:DATAGRIDPAGER id="dgPagerUp" runat="server"></PAGER:DATAGRIDPAGER></td>
																				</tr>
																				<tr>
																					<td valign="top"><!--width=500px TemplateColumn SortExpression="SenderName" HeaderStyle Width="160px" -->
																						<ASP:DATAGRID id="dgMessages" runat="server" AllowSorting="True" CellPadding="3" PagerStyle-HorizontalAlign="Right" PagerStyle-Mode="NumericPages" AllowCustomPaging="True" AllowPaging="True" Width="100%" GridLines="None" AutoGenerateColumns="False">
																							<itemstyle cssclass="data_grid" verticalalign="Top"></ItemStyle>
																							<headerstyle cssclass="data_grid_header"></HeaderStyle>
																							<columns>
																								<asp:TemplateColumn>
																									<headerstyle width="30px"></HeaderStyle>
																									<headertemplate>
																										<asp:CheckBox id="chkSelectAll" onclick="javascript:SelectAll(this.checked, this.id);" runat="server" ToolTip="Select/Deselect All" AutoPostBack="false"></asp:CheckBox>
																									</HeaderTemplate>
																									<itemtemplate>
																										<asp:CheckBox id=chkSelect onclick="javascript: SelectAll(this.checked, this.id);" runat="server" value='<%# DataBinder.Eval(Container.DataItem, "MessageIDAndType") %>'>
																										</asp:CheckBox>
																									</ItemTemplate>
																									<footerstyle horizontalalign="Left" verticalalign="Top"></FooterStyle>
																								</asp:TemplateColumn>
																								<asp:BoundColumn DataField="Date" HeaderText="Date">
																									<headerstyle width="80px"></HeaderStyle>
																									<itemstyle cssclass="data_grid"></ItemStyle>
																								</asp:BoundColumn>
																								<asp:TemplateColumn HeaderText="From">
																									<headerstyle width="160px"></HeaderStyle>
																									<itemstyle cssclass="data_grid"></ItemStyle>
																									<itemtemplate>
																										<asp:HyperLink id=hlSender runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "URL") %>'  onclick='<%# DataBinder.Eval(Container.DataItem, "OnClickJS") %>'>
																											<%# DataBinder.Eval(Container.DataItem, "SenderName") %>
																										</asp:HyperLink>
																										<br>
																										<img height="4" src="images/spacer.gif" width="1"><br>
																										<asp:HyperLink id=hlSenderImage runat="server" CssClass="small_image" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "From") %>' NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "URL") %>'  onclick='<%# DataBinder.Eval(Container.DataItem, "OnClickJS") %>'>
																										</asp:HyperLink>
																										<img src="images/spacer.gif" height="3" width="1"><br>
																										<asp:image id="imgOnline" runat="server" imageurl='<%# DataBinder.Eval(Container.DataItem, "OnlineImg") %>' >
																										</asp:image>
																									</ItemTemplate>
																								</asp:TemplateColumn>
																								<asp:TemplateColumn HeaderText="Type">
																								<headerstyle width="80px"></headerstyle>
																								<itemtemplate>&nbsp;&nbsp;<asp:Image id=imgType runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "TypeImageURL") %>' ImageAlign="AbsMiddle" ToolTip='<%# DataBinder.Eval(Container.DataItem, "TypeName") %>'></asp:Image>
																								</itemtemplate></asp:TemplateColumn>
																								<asp:TemplateColumn HeaderText="Subject">
																									<headerstyle width="380px"></HeaderStyle>
																									<itemtemplate>
																											<asp:HyperLink id=hlSubject runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "MessageIDAndType") %>' CommandName="ViewMessage" NavigateURL='<%# DataBinder.Eval(Container.DataItem, "ViewMsgURL") %>'>
																											<%# DataBinder.Eval(Container.DataItem, "Subject") %>
																										</asp:HyperLink>
																									<headerstyle width="160px"></HEADERSTYLE>
																									<itemstyle cssclass="data_grid"></ITEMSTYLE>
																									</ItemTemplate>
																								</asp:TemplateColumn>
																							</Columns>
																							<pagerstyle verticalalign="Top" visible="False" horizontalalign="Right" mode="NumericPages"></PagerStyle>
																						</ASP:DATAGRID>
																					</td>
																				</tr>
																				<tr>
																					<td><img src="images/spacer.gif" width="100%" height="1"></td>
																				</tr>
																				<tr>
																					<td valign="middle">
																						<PAGER:DATAGRIDPAGER id="dgPager" runat="server"></PAGER:DATAGRIDPAGER></td>
																				</tr>
																				<tr>
																					<td class="data_grid_header" height="30">&nbsp;&nbsp;<a id="lSelectAll" onclick="javascript: SelectAll(true, 'SelectAll');" href="#">Select 
																							All</a> | <a id="lClearAll" onclick="javascript: SelectAll(false, 'SelectAll');" href="#">
																							Clear All</a><br>
																					</td>
																				</tr>
																				<tr>
																					<td class="mail_address">
																						<asp:button id="btnDelete" runat="server" CssClass="btn" Text="Delete" CausesValidation="False" onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnDelete_Click"></asp:button><br>
																						&nbsp;<br>
																					</td>
																				</tr>
																			</table>
																		</asp:TableCell>
																	</asp:TableRow>
																</asp:table></td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td><!--
			<td class="small" width="10">&nbsp;</td>
			<td class="border_adv" valign="top" width="203" height="100%">
					<table cellspacing="1" cellpadding="0" width="100%" border="0">
							<tr>
									<td class="small" width="10">&nbsp;</td>
									<td class="advertisement" valign="top" align="center" width="199">
										<asp:literal id="litSkyscraperAdvertisement" runat=server></asp:literal>
									</td>
							</tr>
					</table>
			</td>-->
		</tr>
	</table>
</form>
<script language="JavaScript">
function SelectAll(chkVal, idVal) 
{ 
    var frm = document.forms[0];
    
    // Loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        
        // Look for our Header Template's Checkbox
        if (idVal.indexOf ('SelectAll') != -1) 
        {
            // Check if main checkbox is checked, then select or deselect datagrid checkboxes 
                frm.elements[i].checked = chkVal;
            // Work here with the Item Template's multiple checkboxes
        }
        else if(idVal.indexOf ('chkSelect') != -1)
        {
			if(!chkVal){
				frm.elements[3].checked = chkVal;
			}	
        }
        else if (idVal.indexOf ('DeleteThis') != -1) 
        {
            // Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
            if(frm.elements[i].checked == false) 
            {
                frm.elements[3].checked = false; //Uncheck main select all checkbox
            }
        }
    }
}
</script>